* (bug 1805) Initialise $wgContLang before $wgUser
* (bug 2277) Added Friulian language file
* Less gratuitous munging of content sample in delete summary
+* badaccess/badaccesstext to supercede sysop*, developer* messages
=== Caveats ===
wfErrorExit();
}
+ /**
+ * Display an error page noting that a given permission bit is required.
+ * This should generally replace the sysopRequired, developerRequired etc.
+ * @param string $permission key required
+ */
+ function permissionRequired( $permission ) {
+ global $wgUser;
+
+ $this->setPageTitle( wfMsg( 'badaccess' ) );
+ $this->setHTMLTitle( wfMsg( 'errorpagetitle' ) );
+ $this->setRobotpolicy( 'noindex,nofollow' );
+ $this->setArticleRelated( false );
+ $this->mBodytext = '';
+
+ $sk = $wgUser->getSkin();
+ $ap = $sk->makeKnownLink( wfMsgForContent( 'administrators' ) );
+ $this->addHTML( wfMsgHtml( 'badaccesstext', $ap, $permission ) );
+ $this->returnToMain();
+ }
+
+ /**
+ * @deprecated
+ */
function sysopRequired() {
global $wgUser;
$sk = $wgUser->getSkin();
$ap = $sk->makeKnownLink( wfMsgForContent( 'administrators' ), '' );
- $this->addHTML( wfMsg( 'sysoptext', $ap ) );
+ $this->addHTML( wfMsgHtml( 'sysoptext', $ap ) );
$this->returnToMain();
}
+ /**
+ * @deprecated
+ */
function developerRequired() {
global $wgUser;
$sk = $wgUser->getSkin();
$ap = $sk->makeKnownLink( wfMsgForContent( 'administrators' ), '' );
- $this->addHTML( wfMsg( 'developertext', $ap ) );
+ $this->addHTML( wfMsgHtml( 'developertext', $ap ) );
$this->returnToMain();
}
'Lockdb' => new SpecialPage( 'Lockdb', 'siteadmin' ),
'Unlockdb' => new SpecialPage( 'Unlockdb', 'siteadmin' ),
'Userrights' => new SpecialPage( 'Userrights', 'userrights' ),
- // 'Groups' => new SpecialPage( 'Groups' ), # currently borken
);
global $wgUseValidation ;
*/
function displayRestrictionError() {
global $wgOut;
- if ( $this->mRestriction == "developer" ) {
- $wgOut->developerRequired();
- } else {
- $wgOut->sysopRequired();
- }
+ $wgOut->permissionRequired( $this->mRestriction );
}
/**
'printsubtitle' => "(From {{SERVER}})",
'protectedpage' => 'Protected page',
'administrators' => "Project:Administrators",
+
'sysoptitle' => 'Sysop access required',
'sysoptext' => "The action you have requested can only be
performed by users with \"sysop\" status.
'bureaucrattitle' => 'Bureaucrat access required',
"bureaucrattext" => "The action you have requested can only be
performed by sysops with \"bureaucrat\" status.",
+
+'badaccess' => 'Permission error',
+'badaccesstext' => 'The action you have requested is limited
+to users with the "$2" permission assigned.
+See $1.',
+
'nbytes' => '$1 bytes',
'ok' => 'OK',
'sitetitle' => "{{SITENAME}}",